Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

113
Views
possible unhandled promise rejection: "Unable to find any RSS element in feed

i found this error in other places but not with RSS feed.. so anyway, i'm trying to create a news app with react native using RSS feeds.. i got this one from "huffpost", was mainly logging on the browser (since it's the easier for me to use), i did fetch the data from the RSS feed, parsed it:

const getNews = async () => {
   fetch('https://peaceful-peak-58941.herokuapp.com/https://www.huffpost.com/section/front-page/feed?x=1')
  .then((response) => response.text())
  .then((responseData) => rssParser.parse(responseData))
  .then((rss) => {
    setArticles(rss.items)
  });
}

when i logged it i noticed that it logs twice, once when the state is still empty (still didn't get any feed yet), then the 2nd time is when i get the feed nd the data i need, i was like thats fine since it happened to me before in reactJs but it was "fine" at the time, now i was like okay let me try this on a mobile emulator.. but then instead of it just doing the same thing as in the browser, it just keeps giving me the error "possible unhandled promise rejection: "Unable to find any RSS element in feed" ", why doesn't it display the data since eventually it should get the data? (i tried again on the browser nd it seems to work) (using expo if it matters)

{articles.length > 0 ? articles.map(article=>(
       <View key={article.id} style={{width:"100%"}}>
           <Text style={styles.title}>{article.title}</Text>
           <Image  style={{width:'100%', height:"300px"}}
             source={{uri:`${article.enclosures[0].url}`}}/>
           <Text style={styles.description}>{article.description}</Text>
           
           </View>
     )) : <Text>...</Text>}
about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Fetch will recieve OPTIONS first and send the actual data right after that. You can configure it so you can fetch without the annoying OPTIONS. Just add another parameter {method: 'get'}, in the fetch function

const getNews = async () => {
       fetch('https://peaceful-peak-58941.herokuapp.com/https://www.huffpost.com/section/front-page/feed?x=1', {method:'get'})
      .then((response) => response.text())
      .then((responseData) => rssParser.parse(responseData))
      .then((rss) => {
        setArticles(rss.items)
      });
    }
about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!